Skip to content

Support a custom vacuum or optimize command on vec0 tables #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
asg017 opened this issue Jan 23, 2025 · 0 comments
Open

Support a custom vacuum or optimize command on vec0 tables #185

asg017 opened this issue Jan 23, 2025 · 0 comments

Comments

@asg017
Copy link
Owner

asg017 commented Jan 23, 2025

If you DELETE a lot of vectors in a vec0 index, the vector chunks will contain a lot unused space. Sometimes it can be re-claimed when INSERT'ing new vectors (see #184), but there's no way to re-claim the disk space entirely.

So we should add a new "insert command" like FTS5 that allows you do manually fixup chunks and reclaim space:

INSERT INTO vec_items(vec_items) VALUES ('optimize');

This is easier said than done. This requires:

  • Finding unused entries in older chunks
  • Moving newer chunks into available old positions
  • Deleting "empty" older chunks
  • Making sure parition keys/metadata values stay the same

oh boy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant